﻿using CsvHelper;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Test.PLCController;

namespace Test.Utils
{
    public class ReadDataSheet
    {
        public List<IGrouping<int, DataModel>> ReadRecord()
        {
            var reader = new StreamReader("DataSheet.csv");
            var csvReader = new CsvReader(reader,CultureInfo.InvariantCulture);
            var records = csvReader.GetRecords<DataModel>().ToList();
            List<IGrouping<int, DataModel>> res =records.GroupBy(x => x.BatchReadGrop).ToList();
            return res; 
        }
    }
}
